package com.xkstream.client.nim;


import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by admin on 2016/9/24.
 */
public class GifAttachment extends CustomAttachment {
    int giftNum ;
    String giftID;
    String giftName ;
    String senderName;
    String senderID;
    String giftShowImage;
    int isNeedNoticeAnchor;

    public GifAttachment() {
        super(CustomAttachmentType.GIF);
    }



    @Override
    public void parseData(String str) {
        try {
            JSONObject jsonObject = new JSONObject(str);
            giftNum = jsonObject.getInt("giftNum");
            giftName = jsonObject.getString("giftName");
            senderName = jsonObject.getString("senderName");
            senderID = jsonObject.getString("senderID");
            giftShowImage = jsonObject.getString("giftShowImage");
            giftID = jsonObject.getString("giftID");
            isNeedNoticeAnchor = jsonObject.getInt("isNeedNoticeAnchor");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    @Override
    public JSONObject packData() {
        JSONObject data = new JSONObject();
        try {
            data.put("giftNum",giftNum);
            data.put("giftID",giftID);
            data.put("giftName",giftName);
            data.put("senderName",senderName);
            data.put("senderID",senderID);
            data.put("giftShowImage",giftShowImage);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return data;
    }

    public int getGiftNum() {
        return giftNum;
    }

    public void setGiftNum(int giftNum) {
        this.giftNum = giftNum;
    }

    public String getGiftID() {
        return giftID;
    }

    public void setGiftID(String giftID) {
        this.giftID = giftID;
    }

    public String getGiftName() {
        return giftName;
    }

    public void setGiftName(String giftName) {
        this.giftName = giftName;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderID() {
        return senderID;
    }

    public void setSenderID(String senderID) {
        this.senderID = senderID;
    }

    public String getGiftShowImage() {
        return giftShowImage;
    }

    public void setGiftShowImage(String giftShowImage) {
        this.giftShowImage = giftShowImage;
    }

    public int getIsNeedNoticeAnchor() {
        return isNeedNoticeAnchor;
    }

    public void setIsNeedNoticeAnchor(int isNeedNoticeAnchor) {
        this.isNeedNoticeAnchor = isNeedNoticeAnchor;
    }
}
